//
//  ShowPopViewSegue.m
//  Karaoke
//
//  Created by 蒋 浩锋 on 12-8-13.
//  Copyright (c) 2012年 Jiang Haofeng. All rights reserved.
//

#import "ShowPopViewSegue.h"
#import "OrderMainViewController.h"

@implementation ShowPopViewSegue

-(void)perform
{
    OrderMainViewController *sourceViewController = self.sourceViewController;
    UIViewController *destinationViewController = self.destinationViewController;
    destinationViewController.view.frame = CGRectMake(0, 0, 310, 522);
    UIPopoverController     *popover = [[UIPopoverController alloc] initWithContentViewController:destinationViewController];
    [popover setValue:[NSNumber numberWithInt:2] forKey:@"popoverBackgroundStyle"];
    [[[popover contentViewController]  view] setBackgroundColor:[UIColor clearColor]];
    sourceViewController.popoverController = popover;
    popover.delegate = sourceViewController;
    [popover presentPopoverFromRect:sourceViewController.currentBtn.bounds inView:sourceViewController.currentBtn permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

}
@end
